package com.wxq.demo.activemq;

import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.core.JmsMessagingTemplate;

/**
 * 订阅的生产者
 */
@Configuration
public class TopicProducter {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    public void sendMessage(String message) {
        ActiveMQTopic destination = new ActiveMQTopic("topic-my");
        jmsMessagingTemplate.convertAndSend(destination, message);
    }
}
